#include <iostream>
using namespace std;

// 定义函数，实现两个数字进行交换函数

// 如果函数不需要返回值，声明的时候可以写void
void swap(int num1, int num2)
{
  cout << "交换前：" << endl;
  cout << num1 << endl;
  cout << num2 << endl;

  int temp = num1;
  num1 = num2;
  num2 = temp;

  cout << "交换后：" << endl;
  cout << num1 << endl;
  cout << num2 << endl;
}

int main(int argc, char const *argv[])
{
  int a = 10;
  int b = 20;
  swap(a, b);

  cout << a << endl;
  cout << b << endl;
  return 0;
}